ACTIVE=${SPRING_PROFILES_ACTIVE:-dev}
PORT=${SERVER_PORT:-9080}
APP_NAME=${APP_NAME:-rbac-admin}
JAVA_OPT=${JAVA_OPT:--Xms128m -Xmx528m}
ps -ef | egrep "server.port=$PORT" | grep -v "grep" |awk '{print $2}' |xargs -I {} kill -9 {}
echo "NAME : $APP_NAME, PORT : $PORT active: $ACTIVE JAVA_OPT：$JAVA_OPT"
nohup java $JAVA_OPT -Dproject.name=${APP_NAME} -jar -Duser.timezone=GMT+08 ${APP_NAME}.jar --server.port=${PORT} --spring.profiles.active=${ACTIVE} > /dev/null 2>&1 &
if [ -f ./logs/${APP_NAME}.log ]; then
        tail -f ./logs/${APP_NAME}.log
    else
      sleep 5
      tail -f ./logs/${APP_NAME}.log
fi




